package ca.badenhorst.ourtrition.model;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by wade on 19/03/14.
 */
public class DVValues {

    private Map<String, DVValue> values = new HashMap<String, DVValue>();

    public DVValues() {
    }

    public void addDVValue(DVValue value) {
        if (value != null) {
            values.put(value.getTag(), value);
        }
    }

    public double getDVValue(String tag, String units){
        DVValue value = values.get(tag);
        if (value == null || !units.equals(value.getUnits()))
        {
            return -1.0;
        }

        return value.getValue();

    }


}
